package com.testfileupload.uploadimg.design.intermediary.zhongjie;



public class Stock extends AbstractColleague{
    //刚开始有一百台
    private static int COMPUTER_NUM = 100;

    public Stock(AbstractMediator abstractMediator) {
        super(abstractMediator);
    }

    //库存增加
    public void increase(int num) {
        COMPUTER_NUM = COMPUTER_NUM + num;
        System.out.println("库存数量为"+COMPUTER_NUM);
    }

    public void decrease(int num) {
        COMPUTER_NUM = COMPUTER_NUM - num;
        System.out.println("库存数量为"+COMPUTER_NUM);
    }

    //获取库存数量
    public int getComputerNum() {
        return COMPUTER_NUM;
    }
    //存货压力大，通知采购人员不要采购，销售人员尽快销售
    public void clearStock(){
       super.abstractMediator.execute("stock.clear");
    }
}
